Exercise 11: Updating nested tables

In this exercise a series of tasks is updated (based on the supplied IRN) in the Events module, demonstrating how to load data into nested tables:

mod_events_nested3_train.gif

When a row is selected in the Tasks table at the bottom of the module window, values in the fields above are updated. Three of these fields above also happen to be tables (tables within a table, hence the name nested table) - Assigned To: (Task Information), Notify: (Commencement) and Notify: (Completion) - containing lists of Party names (they are thus both a table and an attachment field).

The fields used are:

Field

Back-end name

IRN

irn

Description: (Task Information)

TasDescription_tab

Assigned To: (Task Information)

TasPersonAssignedToRef_nesttab

Assigned By: (Task Information)

TasTaskAssignerRef_tab

Date: (Commencement)

TasCommencementDate0

Notify: (Commencement)

TasStartNotifyDate0

Completed: (Completion)

TasCompleted_tab

  1. Before we update an Events record, we will create a very basic record.

    Create a new CSV Import data file with the following details:

    Column Name

    (Row 1)

    Record 1

    (Row 2)

    EveEventTitle

    [Your login name]

  2. Save the Import data file as exercise11_train1.csv (where Train1 is your login name).
  3. Perform a Typical Import (and remember to include your login name as the Import Identifier).
  4. Record the IRN of your new Events record here:__________

    You will be using this record in a later exercise.

  5. Create a new CSV Import data file with the following details.

    Note: So that it is easier to understand what is happening in this import, we'll perform it in stages.

Column Name

(Row 1)

Record 1

(Row 2)

irn

[The IRN noted at Step 4 above].

TasDescription_tab(1)

Check the event dates are available.

[Specifies a value for Description in the first row in the Tasks table.]

 

TasDescription_tab(2)

Organise a committee to overlook the event development.

[Specifies a value for Description in the second row in the Tasks table.]

 

  1. Save the Import data file as exercise11_train1.csv (where Train1 is your login name). [Replace the exercise11 .csv file you created above].
  2. Perform a Typical Import.

    If all goes well, the Tasks tab of your Events record will appear similar to:

    mod_events_nested_train.gif

    Two rows have been added to the Tasks table, each for a separate task. In the screenshot above, the second task has been selected in the Tasks table and its details display in the fields above.

    Let's continue building the Import data file.

  3. Add the following Columns and data to the Import data file exercise11_train1.csv (where Train1 is your login name):

Column Name

(Row 1)

Record 1

(Row 2)

TasPersonAssignedToRef_nesttab(1:1).NamLast

 

[Your login name]

[Assigned To: (Task Information) is a nested table, essentially a table within the Tasks table in this case.

The first 1 in (1:1) makes the association with the first row in the outer table, Tasks in this case.

The second 1 in (1:1) specifies the first row in the nested table, Assigned To: (Task Information) in this case.

This is also an attachment field and specifies the Last: (Person Details) field in the Parties module.

When the import is run, a search will be made in the Parties module using the details you provide.]

 

TasPersonAssignedToRef_nesttab(1:2).NamLast

 

Train19

[Next we specify a value for the second row in the Assigned To: (Task Information) nested table.]

 

TasPersonAssignedToRef_nesttab(2:1).NamLast

 

[Your login name]

[Now we move to the second row in the Tasks table, indicated by the 2 in (2:1).

The 1 in (2:1) specifies the first row in the nested table, Assigned To: (Task Information) in this case.]

 

TasPersonAssignedToRef_nesttab(2:2).NamLast

 

Train19

[Next we specify a value for the second row in the Assigned To: (Task Information) nested table.]

 

  1. Save the Import data file as exercise11_train1.csv (where Train1 is your login name).
  2. Perform a Typical Import.

    If all goes well, the Tasks tab of your Events record will appear similar to:

    mod_events_nested2_train.gif

    The two events recorded in the Tasks table have been updated. In the screenshot above, the second task has been selected and its details display in the fields above. This task has been assigned to two staff members, Train1 and Train19 in this screenshot, and we see that for this second task, two rows have been added to the Assigned To: (Task Information) nested table for these Parties.

  3. Complete the Import data file, exercise11_train1.csv (where Train1 is your login name), with the following details:

    Column Name

    (Row 1)

    Record 1

    (Row 2)

    TasTaskAssignerRef_tab(1).NamFirst

    Joseph

    TasTaskAssignerRef_tab(1).NamLast

    Barnes

    TasTaskAssignerRef_tab(2).NamFirst

    Joseph

    TasTaskAssignerRef_tab(2).NamLast

    Barnes

    TasCommencementDate0(1)

    [Two weeks from today]

    TasCommencementDate0(2)

    [Three weeks from today]

    TasStartNotifyDate0(1)

    [One week from today]

    TasStartNotifyDate0(2)

    [Two weeks from today]

    TasCompleted_tab(1)

    No

    TasCompleted_tab(2)

    No

  4. Save the Import data file as exercise11_train1.csv (where Train1 is your login name).
  5. Perform a Typical Import.

    If all goes well, the Tasks tab of your Events record for task 1 will appear similar to:

    mod_events_nested3_train.gif

    And for task 2:

    mod_events_nested4_train.gif